using System;
using UnityEngine;

[Serializable]
public class TerrainDetail : MonoBehaviour
{
	public int heightmapMaximumLOD;

	public float heightmapPixelError;

	public float basemapDistance;

	public bool castShadows;

	public bool draw;

	public float treeDistance;

	public float detailObjectDistance;

	public float detailObjectDensity;

	public float treeBillboardDistance;

	public float treeCrossFadeLength;

	public int treeMaximumFullLODCount;

	public TerrainDetail()
	{
		heightmapPixelError = 5f;
		basemapDistance = 5000f;
		draw = true;
		treeDistance = 20000f;
		detailObjectDistance = 250f;
		detailObjectDensity = 1f;
		treeBillboardDistance = 200f;
		treeCrossFadeLength = 50f;
		treeMaximumFullLODCount = 50;
	}

	public void Start()
	{
		Terrain terrain = (Terrain)GetComponent(typeof(Terrain));
		terrain.heightmapPixelError = heightmapPixelError;
		terrain.heightmapMaximumLOD = heightmapMaximumLOD;
		if (terrain.GetComponent("ReliefTerrain") == null)
		{
			terrain.basemapDistance = basemapDistance;
		}
		terrain.castShadows = castShadows;
		if (draw)
		{
			terrain.treeDistance = treeDistance;
			terrain.detailObjectDistance = detailObjectDistance;
		}
		else
		{
			terrain.treeDistance = 0f;
			terrain.detailObjectDistance = 0f;
		}
		terrain.detailObjectDensity = detailObjectDensity;
		terrain.treeMaximumFullLODCount = treeMaximumFullLODCount;
		terrain.treeBillboardDistance = treeBillboardDistance;
		terrain.treeCrossFadeLength = treeCrossFadeLength;
		terrain.treeMaximumFullLODCount = treeMaximumFullLODCount;
	}

	public void Main()
	{
	}
}
